#ifndef USER_APP
#define USER_APP
/* ----------------------- Modbus includes ----------------------------------*/
#include "mb.h"
#include "mbconfig.h"
#include "mbframe.h"
#include "mbutils.h"

/* -----------------------Slave Defines -------------------------------------*/

#define S_REG_HOLDING_START 0
#define S_REG_HOLDING_NREGS 100
/* salve mode: holding register's all address */
#define MeterAddr 1
#define Density_Reg 2
#define DynViscosity_Reg 4
#define KinViscosity_Reg 6
#define Temperature_Reg 8
#define StdDensity_Reg 10
#define StdViscosity_Reg 12

#define Save_Reg 20
#define StabilizeValue_Status_Reg 21
#define Calib_density_Status_Reg  22
#define Calib_viscosity_Status_Reg 23
#define Maintenance_status_Reg 24
#define Pid_Ctrl_Status_Reg 25
#define Pid_NO_Measure_Status_Reg 26

#define Setpoint_Reg 50
#define Kp_Reg 52
#define Ki_Reg 54
#define Kd_Reg 56
#define Outmax_Reg 58
#define Outmin_Reg 60
#define PWMoutput_Reg 62
#define PWMDir_Reg 64
#define PIDcal_time_ms_Reg 66

typedef struct _slave_data {
	USHORT *usSRegHoldBuf;

} Slave_data;
extern Slave_data Slave_station;

#endif
